import { importUser } from '@/apis/user/organiza';
<template>
  <div class="divTab" v-loading='loadingTop'>
      <table class="tableClass">
        <tbody>
          <tr>
            <td class="td">数据库名称</td>
            <td>{{tableFrom.dbName}}</td>
            <td>最近更新时间</td>
            <td>{{tableFrom.updateTime}}</td>
          </tr>
          <tr>
            <td>数据库类型</td>
            <td>{{tableFrom.dbType}}</td>
            <td>负责人</td>
            <td>{{tableFrom.userName}}</td>
          </tr>
          <tr>
            <td>所在服务器</td>
            <td>{{tableFrom.host}}</td>
            <td>数据库状态</td>
            <td>{{tableFrom.status | filterState}}</td>
          </tr>
          <tr>
            <td>主服务端口</td>
            <td>{{tableFrom.port}}</td>
            <td>所属部门</td>
            <td>{{tableFrom.deptName}}</td>
          </tr>
          <tr>
            <td>版本</td>
            <td>{{tableFrom.dbversion}}</td>
            <td>备注</td>
            <td>{{tableFrom.description}}</td>
          </tr>
        </tbody>
      </table>
    </div>
</template>
<script>
export default {
    props: ['tableDatas'],
    data () {
        return {
            tableFrom: {},
            loadingTop: true
        };
    },
    watch: {
    // 监听数据是否发生变化
        tableDatas (val) {
            this.tableFrom = val;
            this.loadingTop = false;
        }
    },
    filters: {
        filterState (state) {
            if (state === '1') {
                state = '启用';
            } else if (state === '0') {
                state = '禁用';
            }
            return state;
        }
    }
};
</script>
<style lang="scss" scoped="scoped">
  .divTab .tableClass tbody tr td{
     font-size: 12px;
     padding-left: 10px;
  }
</style>
